package com.ruoyi.stock.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.stock.domain.TransactOperaReplay;
import com.ruoyi.stock.mapper.TransactOperaReplayMapper;
import com.ruoyi.stock.service.ITransactOperaReplayService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 今日操作复盘Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-19
 */
@Service
public class TransactOperaReplayServiceImpl implements ITransactOperaReplayService {

    @Resource
    private TransactOperaReplayMapper transactOperaReplayMapper;

    /**
     * 查询今日操作复盘
     *
     * @param id 今日操作复盘主键
     * @return 今日操作复盘
     */
    @Override
    public TransactOperaReplay selectTransactOperaReplayById(Long id) {
        return transactOperaReplayMapper.selectTransactOperaReplayById(id);
    }

    /**
     * 查询今日操作复盘列表
     *
     * @param transactOperaReplay 今日操作复盘
     * @return 今日操作复盘
     */
    @Override
    public List<TransactOperaReplay> selectTransactOperaReplayList(TransactOperaReplay transactOperaReplay) {
        return transactOperaReplayMapper.selectTransactOperaReplayList(transactOperaReplay);
    }

    /**
     * 新增今日操作复盘
     *
     * @param transactOperaReplay 今日操作复盘
     * @return 结果
     */
    @Override
    public int insertTransactOperaReplay(TransactOperaReplay transactOperaReplay) {
        transactOperaReplay.setCreateTime(DateUtils.getNowDate());
        return transactOperaReplayMapper.insertTransactOperaReplay(transactOperaReplay);
    }

    /**
     * 修改今日操作复盘
     *
     * @param transactOperaReplay 今日操作复盘
     * @return 结果
     */
    @Override
    public int updateTransactOperaReplay(TransactOperaReplay transactOperaReplay) {
        return transactOperaReplayMapper.updateTransactOperaReplay(transactOperaReplay);
    }

    /**
     * 批量删除今日操作复盘
     *
     * @param ids 需要删除的今日操作复盘主键
     * @return 结果
     */
    @Override
    public int deleteTransactOperaReplayByIds(Long[] ids) {
        return transactOperaReplayMapper.deleteTransactOperaReplayByIds(ids);
    }

    /**
     * 删除今日操作复盘信息
     *
     * @param id 今日操作复盘主键
     * @return 结果
     */
    @Override
    public int deleteTransactOperaReplayById(Long id) {
        return transactOperaReplayMapper.deleteTransactOperaReplayById(id);
    }
}
